<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Echarts内置函数</title>
	<script src="../static/js/echarts.js"></script>
	<!-- <script src="../static/js/echarts.min.js"></script> -->
</head>
<body>
	<h1>请看控制台</h1>
</body>
<script type="text/javascript">

// function getVirtulData(year) {
// 	year = year || '2017';
// 	var start = +echarts.number.parseDate(year + '-01-01');
// 	var end = +echarts.number.parseDate(year + '-12-31');
// 	var dayTime = 3600 * 24 * 1000;
// 	var data = [];
// 	for (var time = start; time <= end; time += dayTime) {
// 		data.push([
// 			echarts.time.format(time, '{yyyy}-{MM}-{dd}', false),
// 			Math.floor(Math.random() * 10000)
// 		]);
// 	}
// 	return data;
// }

// console.log(echarts.format.formatTime('yyyy-MM-dd', 1689673264000));		//把时间戳转换为格式化日期，但这个逐渐弃用了
console.log(echarts.time.format(1689673264000, '{yyyy}-{MM}-{dd}'));		//把时间戳转换为格式化日期
console.log(echarts.number.parseDate('2023-07-18'));			//把时间字符串转换为时间对象


</script>
</html>
